//
//  SummaryPieView.swift
//  Share
//
//  Created by admin on 2020/11/24.
//  Copyright © 2020 MBA. All rights reserved.
//

import SwiftUI
import SwiftUICharts

struct SummaryPieView: View {
    @State var half = false
    var body: some View {
        PieChartView(data: [99,23,54,32],
                     title: "Title",
                     legend: "Legendary",
                     style: Styles.pieChartStyleOne
        )
            
            
            .scaleEffect(half ? 1 : 0.2)
            .opacity(half ? 1 : 0.2)
            .animation(
                Animation.easeInOut(duration: 0.75)
                    .delay(0.1)
            )
            .onAppear(){
                withAnimation(Animation.linear.delay(2)){
                    half = true;
                }
            }
    }
}

struct SummaryPieView_Previews: PreviewProvider {
    static var previews: some View {
        SummaryPieView()
    }
}
